package br.perfiman.service;

import java.util.Date;
import java.util.List;

import javax.ejb.Remote;

import br.perfiman.model.Trade;

/**
 *
 * @author Wagner Costa
 * @since 27/12/2007
 * @version 1.0
 *
 */
@Remote
public interface TradeService extends AbstractService<Trade>{
	
	public static Integer TRADES_TYPE_BUY = 1;
	public static Integer TRADES_TYPE_SELL = 2;
	public static Integer TRADES_TYPE_ALL = 3;
	
	/**
	 * Retrieves the Trades who has the same values as passed by example
	 *
	 * @author Wagner Costa
	 * @since 25/03/2008
	 * @version 1.0
	 * @param Trade
	 * @throws Exception
	 */
	List<Trade> findByExample(Trade trade) throws Exception;
	
	/**
	 * Retrieves the Trades who was done in specified period
	 * 
	 * @author Wagner Costa
	 * @since 02/04/2008
	 * @version 1.0
	 * @param initialDate
	 * @param finalDate
	 * @param type
	 * @return
	 */
	List<Trade> retrieveTradesByPeriod(Date initialDate, Date finalDate, Integer Type);
	
	/**
	 * Returns the Total Month's profit
	 * 
	 * @author Wagner Costa
	 * @since 28/05/2008
	 * @version 1.0
	 * @param month
	 * @param year
	 * @return
	 */
	Double getMonthsProfit(Integer month, Integer year);
}
